package com.aiti.ai.dto.ai;

import lombok.Data;

import java.util.Date;
import java.util.List;

/**
 * @description: BoChaWebSearchResponse
 * @auth fcb
 * @date 2025-03-17 11:00
 **/
@Data
public class BoChaWebSearchResponse {

    private Integer code;

    private String log_id;

    private String msg;

    private Data data;

    @lombok.Data
    public static class Data {

        // "SearchResponse" 搜索的类型
        private String _type;

        private WebSearchQueryContext queryContext;

        private WebSearchWebPages webPages;

        private Images images;

        private String videos;
    }

    @lombok.Data
    public static class WebSearchQueryContext {
        // 原始的搜索关键字
        private String originalQuery;
    }

    @lombok.Data
    public static class WebSearchWebPages {
        private String webSearchUrl;
        // int 搜索匹配的网页总数
        private Long totalEstimatedMatches;
        private List<WebPageValue> value;
        // 结果中是否有被安全过滤
        private Boolean someResultsRemoved;
    }

    @lombok.Data
    public static class WebPageValue {
        // 网页的排序ID
        private String id;
        // 网页的标题
        private String name;
        //  网页的URL
        private String url;
        // 网页的展示URL（url decode后的格式）
        private String displayUrl;
        // 网页内容的简短描述
        private String snippet;
        // 网页内容的文本摘要，当请求参数中 summary 为 true 时显示此属性
        private String summary;
        // 网页的网站名称
        private String siteName;
        // 网页的网站图标
        private String siteIcon;
        // 网页的发布时间（此处其实是发布时间，名字起为LastCrawled是兼容性适配）
        private Date dateLastCrawled;
        // 网页的缓存页面URL
        private String cachedPageUrl;
        // 网页的语言
        private String language;
        // 是否为家庭友好的页面
        private String isFamilyFriendly;
        // 是否为导航性页面
        private String isNavigational;
    }

    @lombok.Data
    public static class ImageValue {
        private String webSearchUrl;
        private String name;
        private String thumbnailUrl;
        private String datePublished;
        private String contentUrl;
        private String hostPageUrl;
        private String contentSize;
        private String encodingFormat;
        private String hostPageDisplayUrl;
        private Integer width;
        private Integer height;
        private String thumbnail;
    }

    @lombok.Data
    public static class Images {
        private String id;
        private String readLink;
        private String webSearchUrl;
        private List<ImageValue> value;
        private String isFamilyFriendly;
    }
}
